﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Demo
{
    class Program
    {
        static void Main(string[] args)
        {
            int a = 10;
            int b = 20;
            
            Console.WriteLine( "交换前:"  );
            Console.WriteLine("a="+a+"b="+b);
            int temp;
            temp = a;
            a = b;
            b = temp;
            Console.WriteLine("交换后:");
            Console.WriteLine("a="+a+"b="+b);

            Clos();
            Area();
            Max();




        }
        public static void Clos()
        {
            const double Pe = 3.14;
            int r = 3;
            Console.WriteLine("圆的周长：" + 2 * Pe * r);
            Console.WriteLine("圆的面积：" + Pe * r * r);
        }
        public static void Area()
        {
            Console.WriteLine("请输入一个半径：");
            double r = double.Parse(Console.ReadLine());
            const double Pi = 3.14;
            double b = r;
            Console.WriteLine("圆的面积："+Pi * r * r);

        }
        public static void Show()
        {
            Console.WriteLine("请输入一个四位数：");
            int a = int.Parse(Console.ReadLine());
            Console.WriteLine("千位为："+(a / 1000));
            Console.WriteLine("百位为："+(a / 100)%10);
            Console.WriteLine("十位为："+(a / 10)%10);
            Console.WriteLine("个位为："+(a / 10));

        }
        //用户输入三个数，找出最大的数，打印输出。
        public static void Max()
        {
            Console.WriteLine("请输入三个数：");
            int a = int.Parse(Console.ReadLine());
            int b = int.Parse(Console.ReadLine());
            int c = int.Parse(Console.ReadLine());
            int maxvalue = a;
            if (b > maxvalue)
            {
                maxvalue = b;
            }
            if (c > maxvalue)
            {
                maxvalue = c;
            }
            Console.WriteLine("最大值为："+ maxvalue);
        }
    }
}
